package main

//#link: https://leetcode-cn.com/problems/sort-array-by-parity/
func main() {

}

//双重for循环实现
func sortArrayByParity(A []int) []int {
	resultNums := make([]int, 0)
	for _, num := range A {
		if num%2 == 0 {
			resultNums = append(resultNums, num)
		}
	}

	for _, num := range A {
		if num%2 != 0 {
			resultNums = append(resultNums, num)
		}
	}
	return resultNums
}
